
from flask_restx import Resource
from webargs.flaskparser import use_args
from webargs import fields

from resources.collection import  Collection

from models.timetables import Timetable
from schemas.timetables import TimetableSchema

co = Collection(Timetable,TimetableSchema)

args = {'name':fields.Str(),
        'description':fields.Str(),
        'starttime':fields.DateTime(),
        'endtime':fields.DateTime(),
        }
class TimetableResource(Resource):

    @co.get
    def get(self,id):
        pass

    @use_args(args,location='json')
    @co.put
    def put(self,args,id):
        pass
    
    @co.delete
    def delete(self,id):
        pass

class TimetablesResource(Resource): 
    
    @use_args({'page':fields.Int(missing=1),'per_page':fields.Int(missing=20)},location='query')
    @co.multiget 
    def get(self,args):
        pass

